//
//  XWHBaseTBCell.swift
//  XiaoweHealthy
//
//  Created by Riven on 2022/3/29.
//

import UIKit

class XWHBaseTBCell: UITableViewCell {
    
    lazy var iconView = UIImageView()
    lazy var titleLb = UILabel()
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        backgroundColor = .white
        selectionStyle = .none
        
        addSubViews()
        relayoutSubViews()
    }
    
    required init?(coder: NSCoder) {
//        fatalError("init(coder:) has not been implemented")
        super.init(coder: coder)
    }
    
    func addSubViews() {
        contentView.addSubview(iconView)
        contentView.addSubview(titleLb)
        
        titleLb.font = AppFont.harmonyOSSans(ofSize: 16, weight: .regular)
        titleLb.textColor = majorTextColor
    }
    
    func relayoutSubViews() {
        relayoutOnlyTitleLb()
    }
    
    func relayoutOnlyTitleLb() {
        iconView.isHidden = true
        titleLb.snp.makeConstraints { make in
            make.top.bottom.equalToSuperview().inset(2)
            make.left.right.equalToSuperview().inset(28)
        }
    }

}
